<div id="Moving-directories"></div>
<div class="header">
<p>
Previous: [[cvs: Moving and renaming files#Moving and renaming files|Moving files]], Up: [[cvs: Adding, removing, and renaming files and directories#Adding, removing, and renaming files and directories|Adding and removing]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>

----

<div id="Moving-and-renaming-directories"></div>
=== Moving and renaming directories ===
<div id="index-Moving-directories"></div>
<div id="index-Renaming-directories"></div>
<div id="index-Directories_002c-moving"></div>

The normal way to rename or move a directory is to
rename or move each file within it as described in
[[cvs: The Normal way to Rename#The Normal way to Rename|Outside]].  Then check out with the &lsquo;<code>-P</code>&rsquo;
option, as described in [[cvs: Removing directories#Removing directories|Removing directories]].

If you really want to hack the repository to rename or
delete a directory in the repository, you can do it
like this:


# Inform everyone who has a checked out copy of the directory that the directory will be renamed.  They should commit all their changes, and remove their working copies, before you take the steps below.


# Rename the directory inside the repository.

<div class="example" style="margin-left: 3.2em">
 $ cd $CVSROOT/<var>parent-dir</var>
 $ mv <var>old-dir</var> <var>new-dir</var>
</div>


# Fix the <small>CVS</small> administrative files, if necessary (for instance if you renamed an entire module).


# Tell everyone that they can check out again and continue working.


If someone had a working copy the <small>CVS</small> commands will
cease to work for him, until he removes the directory
that disappeared inside the repository.

It is almost always better to move the files in the
directory instead of moving the directory.  If you move the
directory you are unlikely to be able to retrieve old
releases correctly, since they probably depend on the
name of the directories.

This document was generated on <i>a sunny day</i> using [http://www.nongnu.org/texi2html/ <i>texi2html</i>].
